package chuishop.yiqimaicai.service.Impl;

import chuishop.yiqimaicai.mapper.GoodsMapper;
import chuishop.yiqimaicai.pojo.Goods;
import chuishop.yiqimaicai.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsMapper goodsMapper;

    @Override
    public List<Goods> findAllGoods() {
        return goodsMapper.findAllGoods();
    }

    @Override
    public List<Goods> findGoodsInHouse() {
        return goodsMapper.findGoodsInHouse();
    }

    @Override
    public List<Goods> findGoodsInAB() {
        return goodsMapper.findGoodsInAB();
    }

    @Override
    public List<Goods> findGoodsInGI() {
        return goodsMapper.findGoodsInGI();
    }

    @Override
    public List<Goods> selectGoodsByTyid(Integer tyid) {
        return goodsMapper.selectGoodsByTyid(tyid);
    }

    @Override
    public List<Goods> selectGoodsByName(String input) {
        return goodsMapper.selectGoodsByName(input);
    }

    @Override
    public boolean addGoods(Goods goods) {
        return goodsMapper.addGoods(goods)>0;
    }

    @Override
    public boolean deleteGoods(String[] ids) {
        return goodsMapper.deleteGoods(ids)>0;
    }

    @Override
    public boolean updateGoods(Goods goods) {
        return goodsMapper.updateGoods(goods)>0;
    }
}
